from tensorflow import keras


# Load data
(x_train,y_train), (x_val, y_val) = keras.datasets.imdb.load_data(num_words=20000)
print(type(x_train)) # <class 'numpy.ndarray'>
print(type(y_train)) # <class 'numpy.ndarray'>
print(len(x_train)) # 25000
print(len(y_train)) # 25000
print(x_train.shape) # (25000,)
print(y_train.shape) # (25000,)
print(x_train[0])
print(type(x_train[0]))
res = -1
for i in range(25000):
    res = max(res, len(x_train[i]))
print(res)
